#include<stdio.h>
#include<string.h>
int compare(char*A,char*B){
    int lena=strlen(A),lenb=strlen(B);
    if(lena>lenb)return 1;
    if(lena<lenb)return -1;
    for(int i=0;i<lena;i++){
        if(A[i]>B[i])return 1;
        if(A[i]<B[i])return -1;
    }
    return 0;
}
void reverse(char*p){
    if(!*p)return ;
    int len=strlen(p);
    int t=*p;
    *p=p[len-1];
    p[len-1]=0;
    reverse(p+1);
    p[len-1]=t;
}
int main(){
    char A[100010],B[100010];
    int C[100010];
    scanf("%s%s",A,B);
    int cmp=compare(A,B);
    if(!cmp){
        printf("0");
        return 0;
    }
    reverse(A),reverse(B);
    char*a=cmp>0?A:B;
    char*b=cmp>0?B:A;
    int i,t,k;
    for(i=t=k=0;i<(int)strlen(a);i++){
        k=a[i]-b[i]+t;
        if(!b[i])k-='0';
        if(k<0){
            k+=10;
            t=-1;
        }
        else t=0;
        C[i]=k;
    }
    for(int j=--i;j>=0;j--){
        if(j==i){
            if(a!=A)printf("-");
            if(!C[j])continue;
        }
        printf("%d",C[j]);
    }
    return -1;
}}